#include "mainwindow.h"
#include "singleclass.h"
#include "factoryclass.h"
#include "proxyclass.h"
#include <QApplication>

int main(int argc, char *argv[])
{
    // 设计模式：单例模式
    SingleClass::getSingle();
    // 设计模式：工厂模式
    auto cat = Factory::getAnimal(Factory::Type::CAT);
    auto dog = Factory::getAnimal(Factory::Type::DOG);
    cat->eat();
    dog->eat();
    // 设计模式：代理模式
    std::shared_ptr<Food> food = std::make_shared<ProxyFood>();
    food->eat("芹菜");
    food->eat("五花肉");
    QApplication a(argc, argv);
    MainWindow w;
    w.show();
    return a.exec();
}
